/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.hl7.v3;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.eclipse.emf.common.util.Enumerator;

/**
 * <!-- begin-user-doc -->
 * A representation of the literals of the enumeration '<em><b>Charset</b></em>',
 * and utility methods for working with them.
 * <!-- end-user-doc -->
 * <!-- begin-model-doc -->
 * vocSet: T14853 (C-0-T14853-cpt)
 * <!-- end-model-doc -->
 * @see org.hl7.v3.V3Package#getCharset()
 * @model extendedMetaData="name='Charset'"
 * @generated
 */
public enum Charset implements Enumerator {
	/**
	 * The '<em><b>EBCDIC</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #EBCDIC_VALUE
	 * @generated
	 * @ordered
	 */
	EBCDIC(0, "EBCDIC", "EBCDIC"),

	/**
	 * The '<em><b>ISO10646UCS2</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #ISO10646UCS2_VALUE
	 * @generated
	 * @ordered
	 */
	ISO10646UCS2(1, "ISO10646UCS2", "ISO-10646-UCS-2"),

	/**
	 * The '<em><b>ISO10646UCS4</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #ISO10646UCS4_VALUE
	 * @generated
	 * @ordered
	 */
	ISO10646UCS4(2, "ISO10646UCS4", "ISO-10646-UCS-4"),

	/**
	 * The '<em><b>ISO88591</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #ISO88591_VALUE
	 * @generated
	 * @ordered
	 */
	ISO88591(3, "ISO88591", "ISO-8859-1"),

	/**
	 * The '<em><b>ISO88592</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #ISO88592_VALUE
	 * @generated
	 * @ordered
	 */
	ISO88592(4, "ISO88592", "ISO-8859-2"),

	/**
	 * The '<em><b>ISO88595</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #ISO88595_VALUE
	 * @generated
	 * @ordered
	 */
	ISO88595(5, "ISO88595", "ISO-8859-5"),

	/**
	 * The '<em><b>JIS2022JP</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #JIS2022JP_VALUE
	 * @generated
	 * @ordered
	 */
	JIS2022JP(6, "JIS2022JP", "JIS-2022-JP"),

	/**
	 * The '<em><b>USASCII</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #USASCII_VALUE
	 * @generated
	 * @ordered
	 */
	USASCII(7, "USASCII", "US-ASCII"),

	/**
	 * The '<em><b>UTF7</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #UTF7_VALUE
	 * @generated
	 * @ordered
	 */
	UTF7(8, "UTF7", "UTF-7"),

	/**
	 * The '<em><b>UTF8</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #UTF8_VALUE
	 * @generated
	 * @ordered
	 */
	UTF8(9, "UTF8", "UTF-8");

	/**
	 * The '<em><b>EBCDIC</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>EBCDIC</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #EBCDIC
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int EBCDIC_VALUE = 0;

	/**
	 * The '<em><b>ISO10646UCS2</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>ISO10646UCS2</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #ISO10646UCS2
	 * @model literal="ISO-10646-UCS-2"
	 * @generated
	 * @ordered
	 */
	public static final int ISO10646UCS2_VALUE = 1;

	/**
	 * The '<em><b>ISO10646UCS4</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>ISO10646UCS4</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #ISO10646UCS4
	 * @model literal="ISO-10646-UCS-4"
	 * @generated
	 * @ordered
	 */
	public static final int ISO10646UCS4_VALUE = 2;

	/**
	 * The '<em><b>ISO88591</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>ISO88591</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #ISO88591
	 * @model literal="ISO-8859-1"
	 * @generated
	 * @ordered
	 */
	public static final int ISO88591_VALUE = 3;

	/**
	 * The '<em><b>ISO88592</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>ISO88592</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #ISO88592
	 * @model literal="ISO-8859-2"
	 * @generated
	 * @ordered
	 */
	public static final int ISO88592_VALUE = 4;

	/**
	 * The '<em><b>ISO88595</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>ISO88595</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #ISO88595
	 * @model literal="ISO-8859-5"
	 * @generated
	 * @ordered
	 */
	public static final int ISO88595_VALUE = 5;

	/**
	 * The '<em><b>JIS2022JP</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>JIS2022JP</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #JIS2022JP
	 * @model literal="JIS-2022-JP"
	 * @generated
	 * @ordered
	 */
	public static final int JIS2022JP_VALUE = 6;

	/**
	 * The '<em><b>USASCII</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>USASCII</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #USASCII
	 * @model literal="US-ASCII"
	 * @generated
	 * @ordered
	 */
	public static final int USASCII_VALUE = 7;

	/**
	 * The '<em><b>UTF7</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>UTF7</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #UTF7
	 * @model literal="UTF-7"
	 * @generated
	 * @ordered
	 */
	public static final int UTF7_VALUE = 8;

	/**
	 * The '<em><b>UTF8</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>UTF8</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #UTF8
	 * @model literal="UTF-8"
	 * @generated
	 * @ordered
	 */
	public static final int UTF8_VALUE = 9;

	/**
	 * An array of all the '<em><b>Charset</b></em>' enumerators.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static final Charset[] VALUES_ARRAY =
		new Charset[] {
			EBCDIC,
			ISO10646UCS2,
			ISO10646UCS4,
			ISO88591,
			ISO88592,
			ISO88595,
			JIS2022JP,
			USASCII,
			UTF7,
			UTF8,
		};

	/**
	 * A public read-only list of all the '<em><b>Charset</b></em>' enumerators.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final List<Charset> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));

	/**
	 * Returns the '<em><b>Charset</b></em>' literal with the specified literal value.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static Charset get(String literal) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			Charset result = VALUES_ARRAY[i];
			if (result.toString().equals(literal)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the '<em><b>Charset</b></em>' literal with the specified name.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static Charset getByName(String name) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			Charset result = VALUES_ARRAY[i];
			if (result.getName().equals(name)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the '<em><b>Charset</b></em>' literal with the specified integer value.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static Charset get(int value) {
		switch (value) {
			case EBCDIC_VALUE: return EBCDIC;
			case ISO10646UCS2_VALUE: return ISO10646UCS2;
			case ISO10646UCS4_VALUE: return ISO10646UCS4;
			case ISO88591_VALUE: return ISO88591;
			case ISO88592_VALUE: return ISO88592;
			case ISO88595_VALUE: return ISO88595;
			case JIS2022JP_VALUE: return JIS2022JP;
			case USASCII_VALUE: return USASCII;
			case UTF7_VALUE: return UTF7;
			case UTF8_VALUE: return UTF8;
		}
		return null;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final int value;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final String name;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final String literal;

	/**
	 * Only this class can construct instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private Charset(int value, String name, String literal) {
		this.value = value;
		this.name = name;
		this.literal = literal;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getValue() {
	  return value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
	  return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLiteral() {
	  return literal;
	}

	/**
	 * Returns the literal value of the enumerator, which is its string representation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		return literal;
	}
	
} //Charset
